#include <stdio.h>

int IsBigEndian() {
    int a = 1;
    char *str;
    str = (char *) &a;
    if (str[sizeof(int) - 1])
        return 1;
    else
        return 0;
}

int main(){
    printf("isbig=%d\n",IsBigEndian());//0
    int a=258;
    char * str;
    str=(char *)&a;
    printf("%d,%d\n",str[0],str[1]);//2,1

}
